package com.slfx.open.api.controller;


import com.slfx.open.api.entity.OpenInterface;
import com.slfx.open.api.service.OpenInterfaceService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @Author: slfx
 * @Date: 2022-10-01
 * @Description:
 **/
@RestController
@RequestMapping("/openInterface")
public class OpenInterfaceController {

    @Resource
    private OpenInterfaceService openInterfaceService;

    /**
     * 根据ID获取
     *
     * @param id
     * @return
     */
    @GetMapping("/getById")
    public OpenInterface getById(@RequestParam("id") Long id) {
        OpenInterface openInterface = openInterfaceService.getById(id);
        return openInterface;
    }

    /**
     * 保存
     *
     * @param openInterface
     * @return
     */
    @PostMapping("/save")
    public boolean save(@RequestBody OpenInterface openInterface) {
        boolean save = openInterfaceService.save(openInterface);
        return save;
    }

}
